#include <iostream>
#include <vector>
#include <list>

using namespace std;

int main()
{
    int ia[] = {0, 1, 2, 3, 4, 5, 6, 7};
    vector<int> iv;
    list<int> il;

    iv.assign(ia, ia + 8);
    il.assign(ia, ia + 8);

    for (vector<int>::iterator iiv = iv.begin(); iiv != iv.end(); )
    {
        if (!(*iiv & 1))
        {
            iiv = iv.erase(iiv);
        }
        else
        {
            iiv++;
        }
    }

    for (int i : iv)
    {
        cout << i << " ";
    }

    cout << endl;

    return 0;
}
